package com.rocketmq.consumer.manage.impl;

import com.rocketmq.consumer.manage.ListenerManager;
import com.rocketmq.consumer.manage.RocketMqManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Topic监听启动
 *
 * @author xuziwen
 * @create 2017-08-15 17:48
 */
@Slf4j
@Component
public class DefaultRocketMqManager implements RocketMqManager {

    @Autowired
    private ListenerManager listenerManager;

    @PostConstruct
    @Override
    public void start() throws Exception {
        listenerManager.register();
    }

    @Override
    public void stop() {
        listenerManager.unregister();
    }
}
